<template>
    <div ref="mainRef" style="width: 100%;height: 100%;"></div>
</template>

<script setup>
import * as echarts from 'echarts';
import { onMounted, ref, defineProps } from 'vue';

const mainRef = ref(null);
const props = defineProps({
    option: {
        default: null,
        type: Object
    }
});
onMounted(() => {
    var myChart = echarts.init(mainRef.value);

    // 绘制图表
    myChart.setOption(props.option);
})
</script>

<style scoped lang="scss"></style>